package edu.sjsu.cs.gui;

import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.util.Random;

import javax.swing.ImageIcon;

public class CardButtonListener implements ActionListener
{
   public CardButtonListener(CardButton button)
   {
      myButton = button;
   }
   public void actionPerformed(ActionEvent e)
   {
      Random generator = new Random();
      int number = generator.nextInt(53)+1;
     
      String pathname = directory + number + ".png";
      ImageIcon card = new ImageIcon(pathname);
      
      myButton.change(card);
      
   }
   public static String directory = "card/";
   private CardButton myButton;

}
